
#include "pt_fs.h"
#include "img_common.h"
#include "img_queue.h"

//#define  CFG_FS_DEBUG

#ifdef PT_BK7258
static int  pt_img_fs_type   = FS_TYPE_MEM ;
static int  pt_font_fs_type  = FS_TYPE_DEV ;
#else
static int  pt_img_fs_type   = FS_TYPE_MEM ;
static int  pt_font_fs_type  = FS_TYPE_LINUX ;
#endif

static char pt_fs_path[1024];

int * loading_img[] = {
    &Loading_00, &Loading_01, &Loading_02, &Loading_03, &Loading_04, 
    &Loading_05, &Loading_06, &Loading_07, &Loading_08, &Loading_09, 
    &Loading_10, &Loading_11, &Loading_12, &Loading_13, &Loading_14, 
    &Loading_15, &Loading_16, &Loading_17
};

#if 1

char * pt_fs_get(char *filename)
{
    void * img_p = NULL;
    memset(pt_fs_path,0,sizeof(pt_fs_path));

    switch(pt_img_fs_type){
    case FS_TYPE_LINUX:
    {
        snprintf(pt_fs_path,1024,"L:res/%s",filename);
        break;
    }
    case FS_TYPE_WINDOWS:
    {

        break;
    }
    case FS_TYPE_DEV:
    {
        snprintf(pt_fs_path,1024,"L:/mnt/lfs/%s",filename);
        break;
    }
    case FS_TYPE_MEM:
    {
        img_p = img_queue_get_byname(filename);
        return (lv_img_dsc_t *)img_p;
        break;
    }
    default:break;
    }

    return pt_fs_path;
}
#else
lv_img_dsc_t * pt_fs_get(char *filename)
{
    lv_img_dsc_t * img_p = NULL;
    img_p = img_queue_get_byname(filename);
    return (lv_img_dsc_t *)img_p;
}
#endif

char * pt_fs_font_get(char *filename)
{
    memset(pt_fs_path,0,sizeof(pt_fs_path));

    switch(pt_font_fs_type){
    case FS_TYPE_LINUX:
    {
        snprintf(pt_fs_path,1024,"res/%s",filename);
        break;
    }
    case FS_TYPE_WINDOWS:
    {

        break;
    }
    case FS_TYPE_DEV:
    {
        snprintf(pt_fs_path,1024,"/mnt/lfs/%s",filename);
        break;
    }
    case FS_TYPE_MEM:
    {

        break;
    }
    default:break;
    }

    return pt_fs_path;
}



